/**
 * 
 */
package jmine.tec.datadigester.positional.meta.factory;

import java.beans.PropertyDescriptor;

import jmine.tec.datadigester.positional.annotations.PositionalStringEntry;
import jmine.tec.datadigester.positional.meta.PositionalFieldMetadata;
import jmine.tec.datadigester.positional.meta.PositionalStringFieldMetadata;

/**
 * {@link PositionalFieldAnnotationSupport} para writers de campos String
 * 
 * @author israel.crisanto
 */
public class PositionalStringAnnotationSupport implements PositionalFieldAnnotationSupport<PositionalStringEntry> {

    /**
     * {@inheritDoc}
     */
    public PositionalFieldMetadata create(PropertyDescriptor property, PositionalStringEntry a) {
        return new PositionalStringFieldMetadata(property, a.description(), a.start(), a.size(), a.shouldTrim());
    }

    /**
     * {@inheritDoc}
     */
    public Class<PositionalStringEntry> annotationClass() {
        return PositionalStringEntry.class;
    }
}